#!/usr/bin/python3
# -*- coding: utf-8 -*-
# @author: zzll0909
# @file: 70.py
# @time: 2025/1/24
# @software: PyCharm

class Solution:
    def climbStairs(self, n: int) -> int:
        result = 0
        match n:
            case 1:
                result = 1
            case 2:
                result = 2
            case _:
                dp = list(range(n))
                dp[0] = 1
                dp[1] = 2
                for i in range(2, n):
                    dp[i] = dp[i - 1] + dp[i - 2]
                result = dp[n - 1]
        return result


if __name__ == "__main__":
    pass
